home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / rastan.c < prev    next >
C/C++ Source or Header  |  2000-05-04  |  21KB  |  571 lines

  1. /***************************************************************************
  2.  
  3. Rastan
  4.  
  5. driver by Jarek Burczynski
  6.  
  7. ***************************************************************************/
  8.  
  9. #include "driver.h"
  10. #include "vidhrdw/generic.h"
  11.  
  12. unsigned char *rastan_ram;
  13. extern unsigned char *rastan_videoram1,*rastan_videoram3;
  14. extern size_t rastan_videoram_size;
  15. extern unsigned char *rastan_spriteram;
  16. extern unsigned char *rastan_scrollx;
  17. extern unsigned char *rastan_scrolly;
  18.  
  19. WRITE_HANDLER( rastan_spriteram_w );
  20. READ_HANDLER( rastan_spriteram_r );
  21. WRITE_HANDLER( rastan_videoram1_w );
  22. READ_HANDLER( rastan_videoram1_r );
  23. WRITE_HANDLER( rastan_videoram3_w );
  24. READ_HANDLER( rastan_videoram3_r );
  25.  
  26. WRITE_HANDLER( rastan_scrollY_w );
  27. WRITE_HANDLER( rastan_scrollX_w );
  28.  
  29. WRITE_HANDLER( rastan_videocontrol_w );
  30. WRITE_HANDLER( rastan_flipscreen_w );
  31.  
  32. int rastan_interrupt(void);
  33. int rastan_s_interrupt(void);
  34.  
  35. WRITE_HANDLER( rastan_background_w );
  36. void rastan_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  37.  
  38. int  rastan_vh_start(void);
  39. void rastan_vh_stop(void);
  40.  
  41. WRITE_HANDLER( rastan_sound_w );
  42. READ_HANDLER( rastan_sound_r );
  43.  
  44.  
  45.  
  46. READ_HANDLER( rastan_a001_r );
  47. WRITE_HANDLER( rastan_a000_w );
  48. WRITE_HANDLER( rastan_a001_w );
  49. WRITE_HANDLER( rastan_adpcm_trigger_w );
  50.  
  51. WRITE_HANDLER( rastan_c000_w );
  52. WRITE_HANDLER( rastan_d000_w );
  53.  
  54. void rastan_irq_handler(int irq);
  55.  
  56. int rastan_interrupt(void)
  57. {
  58.     return 5;  /*Interrupt vector 5*/
  59. }
  60.  
  61. static READ_HANDLER( rastan_input_r )
  62. {
  63.     switch (offset)
  64.     {
  65.         case 0:
  66.             return input_port_0_r (offset);
  67.         case 2:
  68.             return input_port_1_r (offset);
  69.         case 6:
  70.             return input_port_2_r (offset);
  71.         case 8:
  72.             return input_port_3_r (offset);
  73.         case 10:
  74.             return input_port_4_r (offset);
  75.         default:
  76.             return 0;
  77.     }
  78. }
  79.  
  80. static READ_HANDLER( rastan_cycle_r )
  81. {
  82.     if (cpu_get_pc()==0x3b088) cpu_spinuntil_int();
  83.  
  84.     return READ_WORD(&rastan_ram[0x1c10]);
  85. }
  86.  
  87.  
  88. static struct MemoryReadAddress rastan_readmem[] =
  89. {
  90.     { 0x000000, 0x05ffff, MRA_ROM },
  91. //    { 0x10dc10, 0x10dc13, rastan_speedup_r },
  92. { 0x10dc10, 0x10dc11, rastan_cycle_r },
  93.     { 0x10c000, 0x10ffff, MRA_BANK1 },    /* RAM */
  94.     { 0x200000, 0x20ffff, paletteram_word_r },
  95.     { 0x3e0000, 0x3e0003, rastan_sound_r },
  96.     { 0x390000, 0x39000f, rastan_input_r },
  97.     { 0xc00000, 0xc03fff, rastan_videoram1_r },
  98.     { 0xc04000, 0xc07fff, MRA_BANK2 },
  99.     { 0xc08000, 0xc0bfff, rastan_videoram3_r },
  100.     { 0xc0c000, 0xc0ffff, MRA_BANK3 },
  101.     { 0xd00000, 0xd0ffff, MRA_BANK4 },
  102.     { -1 }  /* end of table */
  103. };
  104.  
  105. static struct MemoryWriteAddress rastan_writemem[] =
  106. {
  107.     { 0x000000, 0x05ffff, MWA_ROM },
  108. //    { 0x10dc10, 0x10dc13, rastan_speedup_w },
  109.     { 0x10c000, 0x10ffff, MWA_BANK1, &rastan_ram },
  110.     { 0x200000, 0x20ffff, paletteram_xBBBBBGGGGGRRRRR_word_w, &paletteram },
  111.     { 0x350008, 0x35000b, MWA_NOP },     /* 0 only (often) ? */
  112.     { 0x380000, 0x380003, rastan_videocontrol_w },    /* sprite palette bank, coin counters, other unknowns */
  113.     { 0x3c0000, 0x3c0003, MWA_NOP },     /*0000,0020,0063,0992,1753 (very often) watchdog? */
  114.     { 0x3e0000, 0x3e0003, rastan_sound_w },
  115.     { 0xc00000, 0xc03fff, rastan_videoram1_w, &rastan_videoram1, &rastan_videoram_size },
  116.     { 0xc04000, 0xc07fff, MWA_BANK2 },
  117.     { 0xc08000, 0xc0bfff, rastan_videoram3_w, &rastan_videoram3 },
  118.     { 0xc0c000, 0xc0ffff, MWA_BANK3 },
  119.     { 0xc20000, 0xc20003, rastan_scrollY_w, &rastan_scrolly },  /* scroll Y  1st.w plane1  2nd.w plane2 */
  120.     { 0xc40000, 0xc40003, rastan_scrollX_w, &rastan_scrollx },  /* scroll X  1st.w plane1  2nd.w plane2 */
  121.     { 0xc50000, 0xc50003, rastan_flipscreen_w },     /* bit 0  flipscreen*/
  122.     { 0xd00000, 0xd0ffff, MWA_BANK4, &rastan_spriteram },
  123.     { -1 }  /* end of table */
  124. };
  125.  
  126.  
  127. static WRITE_HANDLER( rastan_bankswitch_w )
  128. {
  129.     int bankaddress;
  130.     unsigned char *RAM = memory_region(REGION_CPU2);
  131.  
  132.     bankaddress = 0x10000 + ((data^1) & 0x01) * 0x4000;
  133.     cpu_setbank(5,&RAM[bankaddress]);
  134. }
  135.  
  136. static struct MemoryReadAddress rastan_s_readmem[] =
  137. {
  138.     { 0x0000, 0x3fff, MRA_ROM },
  139.     { 0x4000, 0x7fff, MRA_BANK5 },
  140.     { 0x8000, 0x8fff, MRA_RAM },
  141.     { 0x9001, 0x9001, YM2151_status_port_0_r },
  142.     { 0x9002, 0x9100, MRA_RAM },
  143.     { 0xa001, 0xa001, rastan_a001_r },
  144.     { -1 }  /* end of table */
  145. };
  146.  
  147. static struct MemoryWriteAddress rastan_s_writemem[] =
  148. {
  149.     { 0x0000, 0x7fff, MWA_ROM },
  150.     { 0x8000, 0x8fff, MWA_RAM },
  151.     { 0x9000, 0x9000, YM2151_register_port_0_w },
  152.     { 0x9001, 0x9001, YM2151_data_port_0_w },
  153.     { 0xa000, 0xa000, rastan_a000_w },
  154.     { 0xa001, 0xa001, rastan_a001_w },
  155.     { 0xb000, 0xb000, rastan_adpcm_trigger_w },
  156.     { 0xc000, 0xc000, rastan_c000_w },
  157.     { 0xd000, 0xd000, rastan_d000_w },
  158.     { -1 }  /* end of table */
  159. };
  160.  
  161.  
  162.  
  163. INPUT_PORTS_START( rastan )
  164.     PORT_START    /* IN0 */
  165.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY )
  166.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY )
  167.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY )
  168.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  169.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  170.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
  171.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  172.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  173.  
  174.     PORT_START    /* IN1 */
  175.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY | IPF_COCKTAIL )
  176.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_COCKTAIL )
  177.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_COCKTAIL )
  178.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  179.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  180.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  181.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  182.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  183.  
  184.     PORT_START    /* IN2 */
  185.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 )
  186.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
  187.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )
  188.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
  189.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
  190.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
  191.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 )
  192.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  193.  
  194.     PORT_START    /* DSW0 */
  195.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
  196.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  197.     PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
  198.     PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )
  199.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  200.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  201.     PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
  202.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
  203.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  204.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  205.     PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) )
  206.     PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
  207.     PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )
  208.     PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
  209.     PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
  210.     PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) )
  211.     PORT_DIPSETTING(    0xc0, DEF_STR( 1C_2C ) )
  212.     PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )
  213.     PORT_DIPSETTING(    0x40, DEF_STR( 1C_4C ) )
  214.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )
  215.  
  216.     PORT_START    /* DSW1 */
  217.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
  218.     PORT_DIPSETTING(    0x02, "Easy" )
  219.     PORT_DIPSETTING(    0x03, "Medium" )
  220.     PORT_DIPSETTING(    0x01, "Hard" )
  221.     PORT_DIPSETTING(    0x00, "Hardest" )
  222.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )
  223.     PORT_DIPSETTING(    0x0c, "100000" )
  224.     PORT_DIPSETTING(    0x08, "150000" )
  225.     PORT_DIPSETTING(    0x04, "200000" )
  226.     PORT_DIPSETTING(    0x00, "250000" )
  227.     PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )
  228.     PORT_DIPSETTING(    0x30, "3" )
  229.     PORT_DIPSETTING(    0x20, "4" )
  230.     PORT_DIPSETTING(    0x10, "5" )
  231.     PORT_DIPSETTING(    0x00, "6" )
  232.     PORT_DIPNAME( 0x40, 0x40, "Allow Continue" )
  233.     PORT_DIPSETTING(    0x00, DEF_STR( No ) )
  234.     PORT_DIPSETTING(    0x40, DEF_STR( Yes ) )
  235.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  236.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  237.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  238. INPUT_PORTS_END
  239.  
  240. /* same as rastan, coinage is different */
  241. INPUT_PORTS_START( rastsaga )
  242.     PORT_START    /* IN0 */
  243.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY )
  244.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY )
  245.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY )
  246.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  247.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  248.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
  249.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  250.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  251.  
  252.     PORT_START    /* IN1 */
  253.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY | IPF_COCKTAIL )
  254.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_COCKTAIL )
  255.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_COCKTAIL )
  256.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  257.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  258.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  259.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  260.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  261.  
  262.     PORT_START    /* IN2 */
  263.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 )
  264.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
  265.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )
  266.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
  267.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
  268.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
  269.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 )
  270.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  271.  
  272.     PORT_START    /* DSW0 */
  273.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
  274.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  275.     PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
  276.     PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )
  277.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  278.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  279.     PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
  280.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
  281.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  282.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  283.     PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) )
  284.     PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
  285.     PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
  286.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )
  287.     PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
  288.     PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) )
  289.     PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
  290.     PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) )
  291.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )
  292.     PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
  293.  
  294.     PORT_START    /* DSW1 */
  295.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
  296.     PORT_DIPSETTING(    0x02, "Easy" )
  297.     PORT_DIPSETTING(    0x03, "Medium" )
  298.     PORT_DIPSETTING(    0x01, "Hard" )
  299.     PORT_DIPSETTING(    0x00, "Hardest" )
  300.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )
  301.     PORT_DIPSETTING(    0x0c, "100000" )
  302.     PORT_DIPSETTING(    0x08, "150000" )
  303.     PORT_DIPSETTING(    0x04, "200000" )
  304.     PORT_DIPSETTING(    0x00, "250000" )
  305.     PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )
  306.     PORT_DIPSETTING(    0x30, "3" )
  307.     PORT_DIPSETTING(    0x20, "4" )
  308.     PORT_DIPSETTING(    0x10, "5" )
  309.     PORT_DIPSETTING(    0x00, "6" )
  310.     PORT_DIPNAME( 0x40, 0x40, "Allow Continue" )
  311.     PORT_DIPSETTING(    0x00, DEF_STR( No ) )
  312.     PORT_DIPSETTING(    0x40, DEF_STR( Yes ) )
  313.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  314.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  315.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  316. INPUT_PORTS_END
  317.  
  318.  
  319.  
  320. static struct GfxLayout spritelayout1 =
  321. {
  322.     8,8,    /* 8*8 sprites */
  323.     0x4000,    /* 16384 sprites */
  324.     4,    /* 4 bits per pixel */
  325.     { 0, 1, 2, 3 },
  326.     { 0, 4, 0x40000*8+0 ,0x40000*8+4, 8+0, 8+4, 0x40000*8+8+0, 0x40000*8+8+4 },
  327.     { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
  328.     16*8    /* every sprite takes 16 consecutive bytes */
  329. };
  330.  
  331. static struct GfxLayout spritelayout2 =
  332. {
  333.     16,16,    /* 16*16 sprites */
  334.     4096,    /* 4096 sprites */
  335.     4,    /* 4 bits per pixel */
  336.     { 0, 1, 2, 3 },
  337.     {
  338.     0, 4, 0x40000*8+0 ,0x40000*8+4,
  339.     8+0, 8+4, 0x40000*8+8+0, 0x40000*8+8+4,
  340.     16+0, 16+4, 0x40000*8+16+0, 0x40000*8+16+4,
  341.     24+0, 24+4, 0x40000*8+24+0, 0x40000*8+24+4
  342.     },
  343.     { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32,
  344.             8*32, 9*32, 10*32, 11*32, 12*32, 13*32, 14*32, 15*32 },
  345.     64*8    /* every sprite takes 64 consecutive bytes */
  346. };
  347.  
  348. static struct GfxDecodeInfo gfxdecodeinfo[] =
  349. {
  350.     { REGION_GFX1, 0, &spritelayout1,  0, 0x80 },    /* sprites 8x8*/
  351.     { REGION_GFX2, 0, &spritelayout2,  0, 0x80 },    /* sprites 16x16*/
  352.     { -1 } /* end of array */
  353. };
  354.  
  355.  
  356.  
  357. static struct YM2151interface ym2151_interface =
  358. {
  359.     1,            /* 1 chip */
  360.     4000000,    /* 4 MHz ? */
  361.     { YM3012_VOL(50,MIXER_PAN_CENTER,50,MIXER_PAN_CENTER) },
  362.     { rastan_irq_handler },
  363.     { rastan_bankswitch_w }
  364. };
  365.  
  366.  
  367. struct ADPCMsample rastan_samples[] =
  368. {
  369.     { 0x00, 0x0000, 0x0200*2 },
  370.     { 0x02, 0x0200, 0x0500*2 },
  371.     { 0x07, 0x0700, 0x2100*2 },
  372.     { 0x28, 0x2800, 0x3b00*2 },
  373.     { 0x63, 0x6300, 0x4e00*2 },
  374.     { 0xb1, 0xb100, 0x1600*2 }
  375. };
  376.  
  377. static void adpcm_init(const struct ADPCMinterface *adpcm_intf, struct ADPCMsample *sample_list, int max)
  378. {
  379.     memcpy(sample_list,rastan_samples,sizeof(rastan_samples));
  380. }
  381.  
  382. static struct ADPCMinterface adpcm_interface =
  383. {
  384.     1,            /* 1 chip */
  385.     8000,       /* 8000Hz playback */
  386.     REGION_SOUND1,    /* memory region */
  387.     adpcm_init,    /* init function */
  388.     { 60 }
  389. };
  390.  
  391.  
  392.  
  393. static struct MachineDriver machine_driver_rastan =
  394. {
  395.     /* basic machine hardware */
  396.     {
  397.         {
  398.             CPU_M68000,
  399.             8000000,    /* 8 Mhz */
  400.             rastan_readmem,rastan_writemem,0,0,
  401.             rastan_interrupt,1
  402.         },
  403.         {
  404.             CPU_Z80,
  405.             4000000,    /* 4 Mhz */
  406.             rastan_s_readmem,rastan_s_writemem,0,0,
  407.             ignore_interrupt,1
  408.         }
  409.     },
  410.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  411.     10,    /* 10 CPU slices per frame - enough for the sound CPU to read all commands */
  412.     0,
  413.  
  414.     /* video hardware */
  415.     40*8, 32*8, { 0*8, 40*8-1, 1*8, 31*8-1 },
  416.     gfxdecodeinfo,
  417.     2048, 2048,
  418.     0,
  419.  
  420.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  421.     0,
  422.     rastan_vh_start,
  423.     rastan_vh_stop,
  424.     rastan_vh_screenrefresh,
  425.  
  426.     /* sound hardware */
  427.     0,0,0,0,
  428.     {
  429.         {
  430.             SOUND_YM2151,
  431.             &ym2151_interface
  432.         },
  433.         {
  434.             SOUND_ADPCM,
  435.             &adpcm_interface
  436.         }
  437.     }
  438. };
  439.  
  440.  
  441.  
  442. /***************************************************************************
  443.  
  444.   Game driver(s)
  445.  
  446. ***************************************************************************/
  447.  
  448. ROM_START( rastan )
  449.     ROM_REGION( 0x60000, REGION_CPU1 )    /* 6*64k for 68000 code */
  450.     ROM_LOAD_EVEN( "ic19_38.bin", 0x00000, 0x10000, 0x1c91dbb1 )
  451.     ROM_LOAD_ODD ( "ic07_37.bin", 0x00000, 0x10000, 0xecf20bdd )
  452.     ROM_LOAD_EVEN( "ic20_40.bin", 0x20000, 0x10000, 0x0930d4b3 )
  453.     ROM_LOAD_ODD ( "ic08_39.bin", 0x20000, 0x10000, 0xd95ade5e )
  454.     ROM_LOAD_EVEN( "ic21_42.bin", 0x40000, 0x10000, 0x1857a7cb )
  455.     ROM_LOAD_ODD ( "ic09_43.bin", 0x40000, 0x10000, 0xc34b9152 )
  456.  
  457.     ROM_REGION( 0x1c000, REGION_CPU2 )    /* 64k for the audio CPU */
  458.     ROM_LOAD( "ic49_19.bin", 0x00000, 0x4000, 0xee81fdd8 )
  459.     ROM_CONTINUE(            0x10000, 0xc000 )
  460.  
  461.     ROM_REGION( 0x080000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  462.     ROM_LOAD( "ic40_01.bin",  0x00000, 0x20000, 0xcd30de19 )        /* 8x8 0 */
  463.     ROM_LOAD( "ic39_03.bin",  0x20000, 0x20000, 0xab67e064 )        /* 8x8 0 */
  464.     ROM_LOAD( "ic67_02.bin",  0x40000, 0x20000, 0x54040fec )        /* 8x8 1 */
  465.     ROM_LOAD( "ic66_04.bin",  0x60000, 0x20000, 0x94737e93 )        /* 8x8 1 */
  466.  
  467.     ROM_REGION( 0x080000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  468.     ROM_LOAD( "ic15_05.bin",  0x00000, 0x20000, 0xc22d94ac )        /* sprites 1a */
  469.     ROM_LOAD( "ic14_07.bin",  0x20000, 0x20000, 0xb5632a51 )        /* sprites 3a */
  470.     ROM_LOAD( "ic28_06.bin",  0x40000, 0x20000, 0x002ccf39 )        /* sprites 1b */
  471.     ROM_LOAD( "ic27_08.bin",  0x60000, 0x20000, 0xfeafca05 )        /* sprites 3b */
  472.  
  473.     ROM_REGION( 0x10000, REGION_SOUND1 )    /* 64k for the samples */
  474.     ROM_LOAD( "ic76_20.bin", 0x0000, 0x10000, 0xfd1a34cc ) /* samples are 4bit ADPCM */
  475. ROM_END
  476.  
  477. ROM_START( rastanu )
  478.     ROM_REGION( 0x60000, REGION_CPU1 )    /* 6*64k for 68000 code */
  479.     ROM_LOAD_EVEN( "ic19_38.bin", 0x00000, 0x10000, 0x1c91dbb1 )
  480.     ROM_LOAD_ODD ( "ic07_37.bin", 0x00000, 0x10000, 0xecf20bdd )
  481.     ROM_LOAD_EVEN( "b04-45.20",   0x20000, 0x10000, 0x362812dd )
  482.     ROM_LOAD_ODD ( "b04-44.8",    0x20000, 0x10000, 0x51cc5508 )
  483.     ROM_LOAD_EVEN( "ic21_42.bin", 0x40000, 0x10000, 0x1857a7cb )
  484.     ROM_LOAD_ODD ( "b04-41-1.9",  0x40000, 0x10000, 0xbd403269 )
  485.  
  486.     ROM_REGION( 0x1c000, REGION_CPU2 )    /* 64k for the audio CPU */
  487.     ROM_LOAD( "ic49_19.bin", 0x00000, 0x4000, 0xee81fdd8 )
  488.     ROM_CONTINUE(            0x10000, 0xc000 )
  489.  
  490.     ROM_REGION( 0x080000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  491.     ROM_LOAD( "ic40_01.bin",  0x00000, 0x20000, 0xcd30de19 )        /* 8x8 0 */
  492.     ROM_LOAD( "ic39_03.bin",  0x20000, 0x20000, 0xab67e064 )        /* 8x8 0 */
  493.     ROM_LOAD( "ic67_02.bin",  0x40000, 0x20000, 0x54040fec )        /* 8x8 1 */
  494.     ROM_LOAD( "ic66_04.bin",  0x60000, 0x20000, 0x94737e93 )        /* 8x8 1 */
  495.  
  496.     ROM_REGION( 0x080000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  497.     ROM_LOAD( "ic15_05.bin",  0x00000, 0x20000, 0xc22d94ac )        /* sprites 1a */
  498.     ROM_LOAD( "ic14_07.bin",  0x20000, 0x20000, 0xb5632a51 )        /* sprites 3a */
  499.     ROM_LOAD( "ic28_06.bin",  0x40000, 0x20000, 0x002ccf39 )        /* sprites 1b */
  500.     ROM_LOAD( "ic27_08.bin",  0x60000, 0x20000, 0xfeafca05 )        /* sprites 3b */
  501.  
  502.     ROM_REGION( 0x10000, REGION_SOUND1 )    /* 64k for the samples */
  503.     ROM_LOAD( "ic76_20.bin", 0x0000, 0x10000, 0xfd1a34cc ) /* samples are 4bit ADPCM */
  504. ROM_END
  505.  
  506. ROM_START( rastanu2 )
  507.     ROM_REGION( 0x60000, REGION_CPU1 )    /* 6*64k for 68000 code */
  508.     ROM_LOAD_EVEN( "rs19_38.bin", 0x00000, 0x10000, 0xa38ac909 )
  509.     ROM_LOAD_ODD ( "b04-21.7",    0x00000, 0x10000, 0x7c8dde9a )
  510.     ROM_LOAD_EVEN( "b04-23.20",   0x20000, 0x10000, 0x254b3dce )
  511.     ROM_LOAD_ODD ( "b04-22.8",    0x20000, 0x10000, 0x98e8edcf )
  512.     ROM_LOAD_EVEN( "b04-25.21",   0x40000, 0x10000, 0xd1e5adee )
  513.     ROM_LOAD_ODD ( "b04-24.9",    0x40000, 0x10000, 0xa3dcc106 )
  514.  
  515.     ROM_REGION( 0x1c000, REGION_CPU2 )    /* 64k for the audio CPU */
  516.     ROM_LOAD( "ic49_19.bin", 0x00000, 0x4000, 0xee81fdd8 )
  517.     ROM_CONTINUE(            0x10000, 0xc000 )
  518.  
  519.     ROM_REGION( 0x080000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  520.     ROM_LOAD( "ic40_01.bin",  0x00000, 0x20000, 0xcd30de19 )        /* 8x8 0 */
  521.     ROM_LOAD( "ic39_03.bin",  0x20000, 0x20000, 0xab67e064 )        /* 8x8 0 */
  522.     ROM_LOAD( "ic67_02.bin",  0x40000, 0x20000, 0x54040fec )        /* 8x8 1 */
  523.     ROM_LOAD( "ic66_04.bin",  0x60000, 0x20000, 0x94737e93 )        /* 8x8 1 */
  524.  
  525.     ROM_REGION( 0x080000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  526.     ROM_LOAD( "ic15_05.bin",  0x00000, 0x20000, 0xc22d94ac )        /* sprites 1a */
  527.     ROM_LOAD( "ic14_07.bin",  0x20000, 0x20000, 0xb5632a51 )        /* sprites 3a */
  528.     ROM_LOAD( "ic28_06.bin",  0x40000, 0x20000, 0x002ccf39 )        /* sprites 1b */
  529.     ROM_LOAD( "ic27_08.bin",  0x60000, 0x20000, 0xfeafca05 )        /* sprites 3b */
  530.  
  531.     ROM_REGION( 0x10000, REGION_SOUND1 )    /* 64k for the samples */
  532.     ROM_LOAD( "ic76_20.bin", 0x0000, 0x10000, 0xfd1a34cc ) /* samples are 4bit ADPCM */
  533. ROM_END
  534.  
  535. ROM_START( rastsaga )
  536.     ROM_REGION( 0x60000, REGION_CPU1 )    /* 6*64k for 68000 code */
  537.     ROM_LOAD_EVEN( "rs19_38.bin", 0x00000, 0x10000, 0xa38ac909 )
  538.     ROM_LOAD_ODD ( "rs07_37.bin", 0x00000, 0x10000, 0xbad60872 )
  539.     ROM_LOAD_EVEN( "rs20_40.bin", 0x20000, 0x10000, 0x6bcf70dc )
  540.     ROM_LOAD_ODD ( "rs08_39.bin", 0x20000, 0x10000, 0x8838ecc5 )
  541.     ROM_LOAD_EVEN( "rs21_42.bin", 0x40000, 0x10000, 0xb626c439 )
  542.     ROM_LOAD_ODD ( "rs09_43.bin", 0x40000, 0x10000, 0xc928a516 )
  543.  
  544.     ROM_REGION( 0x1c000, REGION_CPU2 )    /* 64k for the audio CPU */
  545.     ROM_LOAD( "ic49_19.bin", 0x00000, 0x4000, 0xee81fdd8 )
  546.     ROM_CONTINUE(            0x10000, 0xc000 )
  547.  
  548.     ROM_REGION( 0x080000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  549.     ROM_LOAD( "ic40_01.bin",  0x00000, 0x20000, 0xcd30de19 )        /* 8x8 0 */
  550.     ROM_LOAD( "ic39_03.bin",  0x20000, 0x20000, 0xab67e064 )        /* 8x8 0 */
  551.     ROM_LOAD( "ic67_02.bin",  0x40000, 0x20000, 0x54040fec )        /* 8x8 1 */
  552.     ROM_LOAD( "ic66_04.bin",  0x60000, 0x20000, 0x94737e93 )        /* 8x8 1 */
  553.  
  554.     ROM_REGION( 0x080000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  555.     ROM_LOAD( "ic15_05.bin",  0x00000, 0x20000, 0xc22d94ac )        /* sprites 1a */
  556.     ROM_LOAD( "ic14_07.bin",  0x20000, 0x20000, 0xb5632a51 )        /* sprites 3a */
  557.     ROM_LOAD( "ic28_06.bin",  0x40000, 0x20000, 0x002ccf39 )        /* sprites 1b */
  558.     ROM_LOAD( "ic27_08.bin",  0x60000, 0x20000, 0xfeafca05 )        /* sprites 3b */
  559.  
  560.     ROM_REGION( 0x10000, REGION_SOUND1 )    /* 64k for the samples */
  561.     ROM_LOAD( "ic76_20.bin", 0x0000, 0x10000, 0xfd1a34cc ) /* samples are 4bit ADPCM */
  562. ROM_END
  563.  
  564.  
  565.  
  566. GAME( 1987, rastan,   0,      rastan, rastan,   0, ROT0, "Taito Corporation Japan", "Rastan (World)")
  567. /* IDENTICAL to rastan, only difference is copyright notice and Coin B coinage */
  568. GAME( 1987, rastanu,  rastan, rastan, rastsaga, 0, ROT0, "Taito America Corporation", "Rastan (US set 1)")
  569. GAME( 1987, rastanu2, rastan, rastan, rastsaga, 0, ROT0, "Taito America Corporation", "Rastan (US set 2)")
  570. GAME( 1987, rastsaga, rastan, rastan, rastsaga, 0, ROT0, "Taito Corporation", "Rastan Saga (Japan)")
  571.